package com.hqyj.dao;


import com.hqyj.entity.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface ServiceDao extends JpaRepository<User,Integer> {

    @Query(value = "SELECT * FROM user WHERE account=:username and password=:password",nativeQuery = true)
    User getPwAndRid(@Param("username") String username,@Param("password")String password);

    @Query(value = "SELECT * FROM user WHERE account=:username ",nativeQuery = true)
    User getRidAndId(@Param("username") String username);

}
